package com.dede.channeltest;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;
import android.widget.Toast;

import com.dede.mcp_tool.AndroidMCPTools;

import java.io.File;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        TextView channelName = (TextView) findViewById(R.id.channel_name);
        long start = System.currentTimeMillis();
        File file = new File(getPackageResourcePath());
        String channel = AndroidMCPTools.read(file);
        long end = System.currentTimeMillis();
        channelName.setText("渠道名：" + channel + "，耗时：" + (end - start) + "ms");
        Toast.makeText(this, "渠道名：" + channel, Toast.LENGTH_SHORT).show();
    }
}
